﻿<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8" />
    <title>Microwave: src/main/java/com/stateforge/statemachine/examples/microwave/Microwave.java Source File</title>
    <link href="/Content/Help.css" rel="stylesheet" type="text/css" />
    <link href="/Content/css/tabs.css" rel="stylesheet" type="text/css" />
    <link href="/Content/css/doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
    <div id="header">
        <img id="logo" alt="StateForge" src="/Content/Images/StateForgeLogo.png" />
        <div id="title">
            <h1>
                Examples using state machines generated by StateBuilderJava
            </h1>
            <h3>
                Microwave: src/main/java/com/stateforge/statemachine/examples/microwave/Microwave.java Source File
            </h3>
        </div>
        <div id="menucontainer">
            <ul id="menu">
                <li><a href="/">Home</a></li>
                <li><a href="/Home/Download">Downloads</a></li>
                <li><a href="/Help/state-machine-tools.aspx">Help</a></li>
                <li><a href="/Home/Faq">F.A.Q</a></li>
                <li><a href="/Home/About">Contact us</a></li>
            </ul>
        </div>
    </div>
<!-- Generated by Doxygen 1.7.4 -->
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>Main&#160;Page</span></a></li>
      <li><a href="namespaces.html"><span>Packages</span></a></li>
      <li><a href="annotated.html"><span>Classes</span></a></li>
      <li class="current"><a href="files.html"><span>Files</span></a></li>
    </ul>
  </div>
  <div id="navrow2" class="tabs2">
    <ul class="tablist">
      <li><a href="files.html"><span>File&#160;List</span></a></li>
    </ul>
  </div>
<div class="header">
  <div class="headertitle">
<div class="title">src/main/java/com/stateforge/statemachine/examples/microwave/Microwave.java</div>  </div>
</div>
<div class="contents">
<a href="_microwave_8java.html">Go to the documentation of this file.</a><div class="fragment"><pre class="fragment"><a name="l00001"></a><a class="code" href="namespacecom_1_1stateforge_1_1statemachine_1_1examples_1_1microwave.html">00001</a> <span class="keyword">package </span>com.stateforge.statemachine.examples.microwave;
<a name="l00002"></a>00002 
<a name="l00003"></a>00003 <span class="keyword">import</span> com.stateforge.statemachine.listener.ObserverConsole;
<a name="l00004"></a>00004 
<a name="l00009"></a><a class="code" href="classcom_1_1stateforge_1_1statemachine_1_1examples_1_1microwave_1_1_microwave.html">00009</a> <span class="keyword">public</span> <span class="keyword">class </span><a class="code" href="classcom_1_1stateforge_1_1statemachine_1_1examples_1_1microwave_1_1_microwave.html">Microwave</a>
<a name="l00010"></a>00010 {
<a name="l00011"></a><a class="code" href="classcom_1_1stateforge_1_1statemachine_1_1examples_1_1microwave_1_1_microwave.html#ac4787847f3c40e7d4f000b5962679226">00011</a>         <span class="keyword">private</span> <a class="code" href="classcom_1_1stateforge_1_1statemachine_1_1examples_1_1microwave_1_1_microwave_action.html">MicrowaveAction</a> <a class="code" href="classcom_1_1stateforge_1_1statemachine_1_1examples_1_1microwave_1_1_microwave.html#ac4787847f3c40e7d4f000b5962679226">action</a>;
<a name="l00012"></a><a class="code" href="classcom_1_1stateforge_1_1statemachine_1_1examples_1_1microwave_1_1_microwave.html#adef40f60d3ea173a8223726a1cfcacb7">00012</a>         <span class="keyword">private</span> MicrowaveContext <a class="code" href="classcom_1_1stateforge_1_1statemachine_1_1examples_1_1microwave_1_1_microwave.html#adef40f60d3ea173a8223726a1cfcacb7">context</a>;
<a name="l00013"></a>00013         
<a name="l00014"></a><a class="code" href="classcom_1_1stateforge_1_1statemachine_1_1examples_1_1microwave_1_1_microwave.html#a26f9d5bb471c308d12e9d0b798028e6c">00014</a>         <span class="keyword">public</span> <a class="code" href="classcom_1_1stateforge_1_1statemachine_1_1examples_1_1microwave_1_1_microwave.html#a26f9d5bb471c308d12e9d0b798028e6c">Microwave</a>(){
<a name="l00015"></a>00015                 this.<a class="code" href="classcom_1_1stateforge_1_1statemachine_1_1examples_1_1microwave_1_1_microwave.html#ac4787847f3c40e7d4f000b5962679226">action</a> = <span class="keyword">new</span> <a class="code" href="classcom_1_1stateforge_1_1statemachine_1_1examples_1_1microwave_1_1_microwave_action.html">MicrowaveAction</a>();
<a name="l00016"></a>00016                 this.<a class="code" href="classcom_1_1stateforge_1_1statemachine_1_1examples_1_1microwave_1_1_microwave.html#adef40f60d3ea173a8223726a1cfcacb7">context</a> = <span class="keyword">new</span> MicrowaveContext(this.<a class="code" href="classcom_1_1stateforge_1_1statemachine_1_1examples_1_1microwave_1_1_microwave.html#ac4787847f3c40e7d4f000b5962679226">action</a>);
<a name="l00017"></a>00017                 this.<a class="code" href="classcom_1_1stateforge_1_1statemachine_1_1examples_1_1microwave_1_1_microwave.html#adef40f60d3ea173a8223726a1cfcacb7">context</a>.setObserver(ObserverConsole.getInstance());
<a name="l00018"></a>00018         }
<a name="l00019"></a>00019 
<a name="l00020"></a><a class="code" href="classcom_1_1stateforge_1_1statemachine_1_1examples_1_1microwave_1_1_microwave.html#a846dc09dd5641bb83c19e1502476afd4">00020</a>         <span class="keyword">public</span> <span class="keywordtype">void</span> <a class="code" href="classcom_1_1stateforge_1_1statemachine_1_1examples_1_1microwave_1_1_microwave.html#a846dc09dd5641bb83c19e1502476afd4">evTurnOn</a>() {
<a name="l00021"></a>00021         this.<a class="code" href="classcom_1_1stateforge_1_1statemachine_1_1examples_1_1microwave_1_1_microwave.html#adef40f60d3ea173a8223726a1cfcacb7">context</a>.evTurnOn();
<a name="l00022"></a>00022     }
<a name="l00023"></a>00023     
<a name="l00024"></a><a class="code" href="classcom_1_1stateforge_1_1statemachine_1_1examples_1_1microwave_1_1_microwave.html#a1c67ff39fc0c7102081000748930ff80">00024</a>     <span class="keyword">public</span> <span class="keywordtype">void</span> <a class="code" href="classcom_1_1stateforge_1_1statemachine_1_1examples_1_1microwave_1_1_microwave.html#a1c67ff39fc0c7102081000748930ff80">evTurnOff</a>() {
<a name="l00025"></a>00025         this.<a class="code" href="classcom_1_1stateforge_1_1statemachine_1_1examples_1_1microwave_1_1_microwave.html#adef40f60d3ea173a8223726a1cfcacb7">context</a>.evTurnOff();
<a name="l00026"></a>00026     }
<a name="l00027"></a>00027 
<a name="l00028"></a><a class="code" href="classcom_1_1stateforge_1_1statemachine_1_1examples_1_1microwave_1_1_microwave.html#adb6b5f259cc4a0c46fcb0c416310fca2">00028</a>     <span class="keyword">public</span> <span class="keywordtype">void</span> <a class="code" href="classcom_1_1stateforge_1_1statemachine_1_1examples_1_1microwave_1_1_microwave.html#adb6b5f259cc4a0c46fcb0c416310fca2">evCookingDone</a>() {
<a name="l00029"></a>00029         this.<a class="code" href="classcom_1_1stateforge_1_1statemachine_1_1examples_1_1microwave_1_1_microwave.html#adef40f60d3ea173a8223726a1cfcacb7">context</a>.evCookingDone();
<a name="l00030"></a>00030     }
<a name="l00031"></a>00031 
<a name="l00032"></a><a class="code" href="classcom_1_1stateforge_1_1statemachine_1_1examples_1_1microwave_1_1_microwave.html#af4f1c9b0b90b05e8929d3c6dcf86d2ec">00032</a>     <span class="keyword">public</span> <span class="keywordtype">void</span> <a class="code" href="classcom_1_1stateforge_1_1statemachine_1_1examples_1_1microwave_1_1_microwave.html#af4f1c9b0b90b05e8929d3c6dcf86d2ec">evDoorClosed</a>() {
<a name="l00033"></a>00033         this.<a class="code" href="classcom_1_1stateforge_1_1statemachine_1_1examples_1_1microwave_1_1_microwave.html#adef40f60d3ea173a8223726a1cfcacb7">context</a>.evDoorClosed();
<a name="l00034"></a>00034     }
<a name="l00035"></a>00035 
<a name="l00036"></a><a class="code" href="classcom_1_1stateforge_1_1statemachine_1_1examples_1_1microwave_1_1_microwave.html#a61c7f4a20314213c45f32c66db588642">00036</a>     <span class="keyword">public</span> <span class="keywordtype">void</span> <a class="code" href="classcom_1_1stateforge_1_1statemachine_1_1examples_1_1microwave_1_1_microwave.html#a61c7f4a20314213c45f32c66db588642">evDoorOpened</a>() {
<a name="l00037"></a>00037         this.<a class="code" href="classcom_1_1stateforge_1_1statemachine_1_1examples_1_1microwave_1_1_microwave.html#adef40f60d3ea173a8223726a1cfcacb7">context</a>.evDoorOpened();
<a name="l00038"></a>00038     }
<a name="l00039"></a>00039 
<a name="l00040"></a><a class="code" href="classcom_1_1stateforge_1_1statemachine_1_1examples_1_1microwave_1_1_microwave.html#ae7393fc9812550e8a9075a18c890a392">00040</a>     <span class="keyword">public</span> <span class="keywordtype">void</span> <a class="code" href="classcom_1_1stateforge_1_1statemachine_1_1examples_1_1microwave_1_1_microwave.html#ae7393fc9812550e8a9075a18c890a392">evStart</a>() {
<a name="l00041"></a>00041         this.<a class="code" href="classcom_1_1stateforge_1_1statemachine_1_1examples_1_1microwave_1_1_microwave.html#adef40f60d3ea173a8223726a1cfcacb7">context</a>.evStart();
<a name="l00042"></a>00042     }
<a name="l00043"></a>00043     
<a name="l00044"></a><a class="code" href="classcom_1_1stateforge_1_1statemachine_1_1examples_1_1microwave_1_1_microwave.html#ab5e28186d443a7933c82a08651c4f12c">00044</a>     <span class="keyword">public</span> <span class="keyword">static</span> <span class="keywordtype">void</span> <a class="code" href="classcom_1_1stateforge_1_1statemachine_1_1examples_1_1microwave_1_1_microwave.html#ab5e28186d443a7933c82a08651c4f12c">main</a>( String[] args )
<a name="l00045"></a>00045     {
<a name="l00046"></a>00046         System.out.println(<span class="stringliteral">&quot;Microwave&quot;</span>);
<a name="l00047"></a>00047         <a class="code" href="classcom_1_1stateforge_1_1statemachine_1_1examples_1_1microwave_1_1_microwave.html">Microwave</a> microwave = <span class="keyword">new</span> <a class="code" href="classcom_1_1stateforge_1_1statemachine_1_1examples_1_1microwave_1_1_microwave.html#a26f9d5bb471c308d12e9d0b798028e6c">Microwave</a>();
<a name="l00048"></a>00048         microwave.<a class="code" href="classcom_1_1stateforge_1_1statemachine_1_1examples_1_1microwave_1_1_microwave.html#ae7393fc9812550e8a9075a18c890a392">evStart</a>();
<a name="l00049"></a>00049         microwave.<a class="code" href="classcom_1_1stateforge_1_1statemachine_1_1examples_1_1microwave_1_1_microwave.html#a61c7f4a20314213c45f32c66db588642">evDoorOpened</a>();
<a name="l00050"></a>00050         microwave.<a class="code" href="classcom_1_1stateforge_1_1statemachine_1_1examples_1_1microwave_1_1_microwave.html#a846dc09dd5641bb83c19e1502476afd4">evTurnOn</a>();
<a name="l00051"></a>00051         microwave.<a class="code" href="classcom_1_1stateforge_1_1statemachine_1_1examples_1_1microwave_1_1_microwave.html#af4f1c9b0b90b05e8929d3c6dcf86d2ec">evDoorClosed</a>();
<a name="l00052"></a>00052         microwave.<a class="code" href="classcom_1_1stateforge_1_1statemachine_1_1examples_1_1microwave_1_1_microwave.html#af4f1c9b0b90b05e8929d3c6dcf86d2ec">evDoorClosed</a>();
<a name="l00053"></a>00053         microwave.<a class="code" href="classcom_1_1stateforge_1_1statemachine_1_1examples_1_1microwave_1_1_microwave.html#adb6b5f259cc4a0c46fcb0c416310fca2">evCookingDone</a>();
<a name="l00054"></a>00054         microwave.<a class="code" href="classcom_1_1stateforge_1_1statemachine_1_1examples_1_1microwave_1_1_microwave.html#a61c7f4a20314213c45f32c66db588642">evDoorOpened</a>();
<a name="l00055"></a>00055         microwave.<a class="code" href="classcom_1_1stateforge_1_1statemachine_1_1examples_1_1microwave_1_1_microwave.html#a1c67ff39fc0c7102081000748930ff80">evTurnOff</a>();
<a name="l00056"></a>00056         microwave.<a class="code" href="classcom_1_1stateforge_1_1statemachine_1_1examples_1_1microwave_1_1_microwave.html#a61c7f4a20314213c45f32c66db588642">evDoorOpened</a>();
<a name="l00057"></a>00057         microwave.<a class="code" href="classcom_1_1stateforge_1_1statemachine_1_1examples_1_1microwave_1_1_microwave.html#a846dc09dd5641bb83c19e1502476afd4">evTurnOn</a>();
<a name="l00058"></a>00058         microwave.<a class="code" href="classcom_1_1stateforge_1_1statemachine_1_1examples_1_1microwave_1_1_microwave.html#af4f1c9b0b90b05e8929d3c6dcf86d2ec">evDoorClosed</a>();        
<a name="l00059"></a>00059     }
<a name="l00060"></a>00060 }
</pre></div></div>
</div>
﻿<div id="footer">
    <hr />
    <p>
        Copyright &copy; 2011 StateForge.</p>
    <hr />
</div>
</body> </html> 
